<?php
/**
 * Created by Zhy
 * User: Zhy
 * Date: 2018/8/9
 * Time: 18:05
 */

namespace app\api\model;


use think\Model;

class ActivityOrder extends Model
{
    public function donateList($where, $donate_id = '', $field, $page, $pageSize = 10){
        if($donate_id == ''){
            $pageNum = $page - 1;
            $donateInfo = $this
                ->where($where)
                ->field($field)
                ->order('donate_id desc')
                ->limit($pageNum * $pageSize, $pageSize)
                ->select();
        }else{
            $donateInfo = $this->alias('d')
                ->join('up_institutional_activities uia', 'uia.id = d.activity_id', 'left')
                ->where($where)
                ->field($field)
                ->find();
        }
        return $donateInfo;
    }
}